import { SET_USER ,UPDATE_USERNAME} from "../actionTypes";
const initState = {
    id: "",
    avatar_url: "",
    username: ""
};

const userReducer = (state = initState, { type, payload }: any) => {
    switch (type) {
        case SET_USER:
            return { ...payload };
            break;
        case UPDATE_USERNAME:
            return {...state,username:payload}
        default:
            return state;
    }
};

export default userReducer;
